﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AQK_XXFLBZ.aspx.cs" Inherits="TONLI.TJOA.Anquan.AQK_XXFLBZ" %>


<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<%@ Register TagPrefix="uc" TagName="WFTreeView" Src="~/Control/WFTreeView.ascx" %>
<%@ Register TagPrefix="uc" TagName="SysRolesList" Src="~/Control/SysRolesList.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script type="text/javascript">
var txtArray;
var nCols;
var funcs;
var parentid;
var objEdit;
function init(){
    funcs=TONLI.TJOA.Anquan.AQK_XXFLBZ;
    nCols =5;
    txtArray =new Array();
    for(i=0;i<nCols;i++){
        txtArray[i] = document.getElementById('txt'+i);  
    }
}
function FolderGrid_ItemSelect(node){
    
}
function treeviewContent_onPaneResize(sender, eventArgs)
        { 
          if(window.treeview1)
          {
            var pane = eventArgs.get_pane();

            if(pane.get_height())
            {
              treeview1.element.parentNode.style.height = (pane.get_height()) + 'px';
            }
            if(pane.get_width() )
            {
              treeview1.element.parentNode.style.width = (pane.get_width() ) + 'px';
            }
            
          }
          }
      function wfTreeNodeSelect(node)
  {
     selectedNode =node;
     
     if(FolderCallBack &&node.ImageUrl == "file.gif"){
        parentid =node.ID;
        FolderCallBack.callback(node.ID);		    
     }
  }
 function add()
{
    if(Dialog2.get_isShowing())
    {
	    return;
    }
    else
    {
        if(!parentid)return;
        for(i=0;i<nCols;i++){
            if(txtArray[i])
            txtArray[i].value="";
        }       
        objEdit=null;
        Dialog2.Show();
    }
}
function edit()
{ 
    objs =FolderGrid.getSelectedItems();
    if(objs)
    {         
        temp_id=objs[0].getMember('SUID').get_value();       
        objEdit =funcs.GetWF_HD(temp_id).value
        
        if(objEdit){
        obj = objEdit;
            txtArray[0].value = obj.INDEX_;
            txtArray[1].value = obj.BM;
            txtArray[2].value = obj.LB;
            txtArray[3].value = obj.JB;
            txtArray[4].value = obj.WTD;
            Dialog2.Show();
        }
    }
}
function del(){

    objs =FolderGrid.getSelectedItems();
    if(objs!=null && objs[0])
    {
        obj = objs[0];
        temp_id =obj.getMember('SUID').get_value()
        
        if(!confirm('确认删除所选记录吗？'))return;
        
        ret =funcs.DelWF_HD(temp_id).value;
        
        if(ret==1)
        {
            FolderGrid.deleteItem(obj);
        }
        objs=null;
    }
}
function dialog2Ok(){    
    
    if(objEdit){
        obj =objEdit;
        obj.INDEX_ = txtArray[0].value;
        obj.BM = txtArray[1].value;
        obj.LB = txtArray[2].value;
        obj.JB = txtArray[3].value;
        obj.WTD = txtArray[4].value;
        ret = funcs.UpdateWF_HD(objEdit).value;
        if(ret!=1) return;
    }else{
        obj=funcs.GetNewWF_HD().value;
        
        if(obj){
            obj.INDEX_ = txtArray[0].value;
            obj.BM = txtArray[1].value;
            obj.LB = txtArray[2].value;
            obj.JB = txtArray[3].value;
            obj.WTD = txtArray[4].value;
            obj.PARENTID = parentid; 
        }
        ret =funcs.AddWF_HD(obj).value;
        if(ret!=1) return;
    }
    Dialog2.Close();
    objEdit=null;
    FolderCallBack.callback(parentid);        
}
function txtOnChanged(sender, maxLen){
    if(sender.value.length>maxLen){
        alert("字符串超出最大长度,超出部分将被自动截断!");
        sender.value=sender.value.substring(0,maxLen);
    }
 }
function exporttoxls(){
    window.open("AQK_XXFLBZ_R.aspx?title="+encodeURI("信息分类"));
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>信息分类标准</title>
    <link href="~/common/toolbarStyle.css" type="text/css" rel="stylesheet" />
    <link href="~/common/folder_grid.css" rel="stylesheet" type="text/css" />
    <link href="~/common/dialog.css" rel="stylesheet" type="text/css" />
    <link href="~/common/treeviewStyle.css" rel="stylesheet" type="text/css" />
    <link href="~/common/splitterStyle.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" language="javascript" src="../common/js/common.js" charset="gb2312"></script>
</head>

<body  style="background-color: #e5f2ff; margin: 0px; overflow:hidden;" onload="init()">
    <form id="form1" runat="server">
        <div>
            <table style="width: 100%; height: 100%;" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td class="h1" style="border-bottom: 1px solid #6593CF;">
                        <div style="width: 100%;">
                            <img id="FolderGridHeadingImage" src="../common/images/treeview/file.gif" alt="无图片" />
                            <div id="FolderGridHeadingText" style="display: inline; padding-left: 6px;">
                                安全管理\信息分类标准</div>
                        </div>
                    </td>
                </tr>
                <tr class="TopToolBarBack">
                    <td style="height: 25px; padding-left: 1px; padding-top: 1px;">
                        <ComponentArt:ToolBar ID="ToolBar1" CssClass="TopToolBar" DefaultItemTextImageRelation="ImageBeforeText"
                            DefaultItemImageHeight="16" DefaultItemImageWidth="16" ImagesBaseUrl="../common/top_panel_images/"
                            ItemSpacing="0" Orientation="Horizontal" UseFadeEffect="false" runat="server">
                            <Items>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarCustomItem" ItemType="Separator" ImageUrl="toolbar_end_left.gif"
                                    ImageWidth="7" ImageHeight="25" />
                                <ComponentArt:ToolBarItem CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ActiveCssClass="TopToolBarImageTextItemActive" ImageUrl="reply.gif" Text="增加"
                                    ClientSideCommand="add()"></ComponentArt:ToolBarItem>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarBreakItem" ItemType="Separator" ImageUrl="break.gif"
                                    ImageHeight="15" ImageWidth="2" />
                                <ComponentArt:ToolBarItem ActiveCssClass="TopToolBarImageTextItemActive" ClientSideCommand="edit()"
                                    CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ImageUrl="reply.gif" Text="修改" />
                                <ComponentArt:ToolBarItem CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ActiveCssClass="TopToolBarImageTextItemActive" ImageUrl="reply.gif" Text="删除"
                                    ClientSideCommand="del()"></ComponentArt:ToolBarItem>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ActiveCssClass="TopToolBarImageTextItemActive" ImageUrl="reply.gif" Text="导出"
                                    ClientSideCommand="exporttoxls()" ></ComponentArt:ToolBarItem>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarImageTextItem" HoverCssClass="TopToolBarImageTextItemHover"
                                    ActiveCssClass="TopToolBarImageTextItemActive" ImageUrl="reply.gif" Text="查询"
                                    ClientSideCommand="query()" Visible="false"></ComponentArt:ToolBarItem>
                                <ComponentArt:ToolBarItem CssClass="TopToolBarCustomItem" ItemType="Separator" ImageUrl="toolbar_end_right.gif"
                                    ImageWidth="13" ImageHeight="25" />
                            </Items>
                        </ComponentArt:ToolBar>
                    </td>
                </tr>
                </table>
                
                <ComponentArt:Splitter runat="server" ID="Splitter1" FillHeight="true" ResizeAdjacentPane="true"
                    ImagesBaseUrl="~/common/images/splitter/" Width="100%">
                    <Layouts>
                        <ComponentArt:SplitterLayout>
                            <Panes Orientation="Horizontal" SplitterBarCollapseImageUrl="splitter_horCol.gif"
                                SplitterBarCollapseHoverImageUrl="splitter_horColHover.gif" SplitterBarExpandImageUrl="splitter_horExp.gif"
                                SplitterBarExpandHoverImageUrl="splitter_horExpHover.gif" SplitterBarCollapseImageWidth="5"
                                SplitterBarCollapseImageHeight="116" SplitterBarCssClass="HorizontalSplitterBar"
                                SplitterBarCollapsedCssClass="CollapsedHorizontalSplitterBar" SplitterBarActiveCssClass="ActiveSplitterBar"
                                SplitterBarWidth="5">
                                <ComponentArt:SplitterPane Width="120" PaneContentId="treeviewContent">
                                <ClientEvents>
                                <PaneResize  EventHandler="treeviewContent_onPaneResize"/>
                                </ClientEvents>
                                </ComponentArt:SplitterPane>
                                <ComponentArt:SplitterPane  PaneContentId="gridContent">
                                </ComponentArt:SplitterPane>
                            </Panes>
                        </ComponentArt:SplitterLayout>
                    </Layouts>
                    <Content>
                    <ComponentArt:SplitterPaneContent ID ="treeviewContent">
                    <ComponentArt:treeview id="treeview1" height="100%" width="100%" 
    DragAndDropEnabled="false" 
        NodeEditingEnabled="false" 
        KeyboardEnabled="true"
        FillContainer="true" 
        CssClass="TreeView" 
        NodeCssClass="TreeNode" 
        SelectedNodeCssClass="SelectedTreeNode" 
        HoverNodeCssClass="HoverTreeNode"
        NodeEditCssClass="NodeEdit"
        LineImageWidth="19" 
        LineImageHeight="20"
        DefaultImageWidth="16" 
        DefaultImageHeight="16"
        ItemSpacing="0" 
        ImagesBaseUrl="~/common/images/treeview/"
        NodeLabelPadding="3"
        ParentNodeImageUrl="folder.gif" 
        ExpandedParentNodeImageUrl="folder_open.gif" 
        LeafNodeImageUrl="file.gif" 
        ShowLines="true" 
        LineImagesFolderUrl="~/common/images/treeview/lines/"
        EnableViewState="true"
        ClientSideOnNodeSelect="wfTreeNodeSelect"
        runat="server" >
 
</ComponentArt:treeview>
                    </ComponentArt:SplitterPaneContent>
                    <ComponentArt:SplitterPaneContent ID="gridContent">
                    <div>
                                        <ComponentArt:CallBack runat="server" ID="FolderCallBack" Width="98%" Height="380"
                                            LoadingPanelFadeDuration="500" LoadingPanelFadeMaximumOpacity="60" OnCallback="FolderCallBack_Callback">
                                            <Content>
                                                <ComponentArt:Grid ID="FolderGrid" FillContainer="true" AutoAdjustPageSize="false"
                                                    DataAreaCssClass="FolderGridData" EnableViewState="true" RunningMode="Callback"
                                                    ShowHeader="false" ShowFooter="true" ScrollBar="Off" ScrollTopBottomImagesEnabled="true"
                                                    ScrollTopBottomImageHeight="2" ScrollTopBottomImageWidth="16" ScrollImagesFolderUrl="../common/folder_grid_images/scroller/"
                                                    ScrollButtonWidth="16" ScrollButtonHeight="17" ScrollBarCssClass="FolderGridScrollBar"
                                                    ScrollGripCssClass="FolderGridScrollGrip" ScrollBarWidth="15" FooterCssClass="FolderGridFooter"
                                                    PageSize="20" LoadingPanelFadeDuration="1000" LoadingPanelFadeMaximumOpacity="60"
                                                    LoadingPanelClientTemplateId="LoadingTemplate" LoadingPanelPosition="TopLeft"
                                                    LoadingPanelOffsetX="1" LoadingPanelOffsetY="20" ImagesBaseUrl="../common/folder_grid_images/"
                                                    runat="server" OnNeedDataSource="FolderGrid_NeedDataSource" OnNeedRebind="FolderGrid_NeedRebind" PagerInfoClientTemplateId="pagerInfoTemplate"
                                                    OnPageIndexChanged="FolderGrid_PageIndexChanged" OnSortCommand="FolderGrid_SortCommand">
                                                    <Levels>
                                                        <ComponentArt:GridLevel AllowGrouping="false" DataKeyField="SUID" ShowTableHeading="false"
                                                            TableHeadingCssClass="FolderGridHeader" RowCssClass="FolderGridRow" ColumnReorderIndicatorImageUrl="reorder.gif"
                                                            DataCellCssClass="FolderGridDataCell" HeadingCellCssClass="FolderGridHeadingCell"
                                                            HeadingCellHoverCssClass="FolderGridHeadingCellHover" HeadingRowCssClass="FolderGridHeadingRow"
                                                            HeadingTextCssClass="FolderGridHeadingCellText" SelectedRowCssClass="FolderGridSelectedRow"
                                                            SortAscendingImageUrl="asc.gif" SortDescendingImageUrl="desc.gif" SortImageWidth="9"
                                                            SortImageHeight="5">
                                                            <Columns>
<ComponentArt:GridColumn HeadingText="序号" DataField="INDEX_" Visible="true" Width="5" />
<ComponentArt:GridColumn HeadingText="编码" DataField="BM" Visible="true" Width="20" />
<ComponentArt:GridColumn HeadingText="类别" DataField="LB" Visible="true" Width="5" />
<ComponentArt:GridColumn HeadingText="级别" DataField="JB" Visible="true" Width="5" />
<ComponentArt:GridColumn HeadingText="问题点" DataField="WTD" Visible="true" Width="100" />
                                                                <ComponentArt:GridColumn HeadingText="" DataField="SUID" Visible="false" Width="100" />
                                                            </Columns>
                                                        </ComponentArt:GridLevel>
                                                    </Levels>
                                                    <ClientTemplates>
                                                    <ComponentArt:ClientTemplate ID ="pagerInfoTemplate">
                                                         ##getPagerInfo(FolderGrid)##
                                                    </ComponentArt:ClientTemplate>
                                                        <ComponentArt:ClientTemplate ID="LoadingTemplate">
                                                            <table width="500" height="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#e0e0e0">
                                                                <tr>
                                                                    <td align="center">
                                                                        <table cellspacing="0" cellpadding="0" border="0">
                                                                            <tr>
                                                                                <td style="font-size: 10px;">
                                                                                    请稍候...&nbsp;</td>
                                                                                <td>
                                                                                    <img src="../common/folder_grid_images/spinner.gif" width="16" height="16" border="0"></td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </ComponentArt:ClientTemplate>
                                                    </ClientTemplates>
                                                    <ClientEvents>
                                                        <ItemSelect EventHandler="FolderGrid_ItemSelect" />
                                                        <%--<Load EventHandler="FolderGrid_Load" />--%>
                                                    </ClientEvents>
                                                </ComponentArt:Grid>
                                            </Content>
                                            <LoadingPanelClientTemplate>
                                                <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#e0e0e0">
                                                    <tr>
                                                        <td align="center">
                                                            <table cellspacing="0" cellpadding="0" border="0">
                                                                <tr>
                                                                    <td style="font-size: 10px;">
                                                                        请稍候...&nbsp;</td>
                                                                    <td>
                                                                        <img src="../common/folder_grid_images/spinner.gif" width="16" height="16" border="0"></td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </LoadingPanelClientTemplate>
                                            <ClientEvents>
                                                <%--<BeforeCallback EventHandler="FolderCallBack_BeforeCallback" />--%>
                                            </ClientEvents>
                                        </ComponentArt:CallBack>
                                    </div>
                    </ComponentArt:SplitterPaneContent>
                    </Content>
                </ComponentArt:Splitter>
            
                <ComponentArt:Dialog  CssClass="dialog" AllowDrag="true" 
                Alignment="MiddleCentre" ID="Dialog2" runat="server" Width="356" Height="307"
                HeaderCssClass="dialog-smmuser"
	            ContentCssClass="dialog-dept-tree"
                >
                <ClientEvents>
                </ClientEvents>
                <Header >
                    <div class="dialog-title draggable" onmousedown="Dialog2.StartDrag(event);">
			            <div class="left"></div>
			            <div class="mid">
				            <a class="close" href="javascript:void(0);" onclick="Dialog2.close();return false;"></a>
				            <span>信息分类标准</span>
			            </div>
			            <div class="right"></div>
		            </div>
                </Header>
                <Content>
                    <div class="dialog-content">
                        <div class="left">
                        </div>
                        <div class="mid">
                            <table class="table" cellpadding="0" cellspacing="1">
                                <tr>
	                                <td class="td-lable" >显示顺序</td>
	                                <td>
		                                <input class="txt l400" id="txt0" type="text" maxlength="50" />
	                                </td>
                                </tr>
                                <tr>
	                                <td class="td-lable" >编码</td>
	                                <td>
		                                <input class="txt l400" id="txt1" type="text" maxlength="50" />
	                                </td>
                                </tr>
                                <tr>
	                                <td class="td-lable" >类别</td>
	                                <td>
		                                <input class="txt l400" id="txt2" type="text" maxlength="50" />
	                                </td>
                                </tr>
                                <tr>
	                                <td class="td-lable" >级别</td>
	                                <td>
		                                <input class="txt l400" id="txt3" type="text" maxlength="50" />
	                                </td>
                                </tr>
                                <tr>
	                                <td class="td-lable" >问题点</td>
	                                <td>
		                                <textarea class="txt l400" id="txt4"   rows="5" cols="10" style="height:100px;" onchange="txtOnChanged(this, 300)"></textarea>
	                                </td>
                                </tr>                        
                            </table>
                        </div>
                        <div class="right">
                        </div>
                    </div>
                    <div class="dialog-buttons">
                        <div class="left">
                        </div>
                        <div class="mid">
                            <a onclick="Dialog2.close();return false;" href="javascript:void(0);" class="button-70 float-right">
                                <span>取消</span></a> <a onclick="dialog2Ok();return false;" href="javascript:void(0);"
                                    class="button-70 float-right"><span>确认</span></a>
                        </div>
                        <div class="right">
                        </div>
                    </div>
                </Content>
                
            </ComponentArt:Dialog>
                      
        </div>
        
    </form>
</body>
</html>